package com.itheima.controller;

import com.itheima.common.Result;
import com.itheima.pojo.Area;
import com.itheima.service.impl.AreaServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class AreaController {

    @Autowired
    private AreaServiceImpl areaService;

    @GetMapping("/area")
    public Result findAll(){
        List<Area> areaList =  areaService.findAll();
        return Result.ok("查询所有城市成功！",areaList);
    }

}
